<script setup>
import {ref} from 'vue'

/**
 * items:
 *   value: ID值
 *   label: 文案
 *   children: 子项数组
 * fn: 选择后的回调函数
 */
let parent = defineProps({
  'items': {type: Array, required: true},
  'fn': {type: Function, required: false},
});

const value = ref([]);

</script>

<template>
  <el-cascader
      v-model="value"
      :options="items"
      :props="{expandTrigger: 'hover'}"
      @change="fn"/>
</template>

<style scoped lang="scss">

</style>